1. Field of the Invention
The present invention relates to a method, an apparatus and a program for recording a file on an information medium. More specifically, the present invention relates to a technique for extending the life of an information medium at a time of file recording by use of a file system.
2. Description of Related Art
In a recording apparatus used for recording information on an information medium such as a hard disk, an optical disk or a flash memory, the information is recorded in a recording area on the information medium. When the information becomes unnecessary, the information is deleted so that the area can be reused for recording other information. In such a recording apparatus, it is general to use a file system for facilitating information management. By using such a file system, recorded information can be managed as a file so as to construct a directory hierarchy. Examples of the file system include FAT (File Allocation Table) used for a personal computer or the like or UDF (Universal Disk Format) used for DVD (Digital Versatile Disk) or the like. With the introduction of such a file system, not only real data to be recorded on the information medium but also management information such as locational information for facilitating access to the real data are recorded on the information medium.
Management information in the file system is concentrated often at a specific spot of an information medium. For example, management information of FAT is recorded in the vicinity of the head on the logical address of the information medium. A personal computer is a well known example as equipment including such a file system. Recently, the file system is included also in video equipment such as a video camera.
The following description is about a conventional file recording apparatus.
A vehicle camera system will be explained below as an example of equipment including a file recording apparatus. A vehicle camera system is formed of a camera unit and a main unit that can record, on an information medium such as a memory card, a video signal taken with the camera unit, and these units are connected through a cable or the like in use. The file recording apparatus is included in the main unit. A typical vehicle camera system has the capability of continuous recording for several hours. Therefore, the number of accesses to an information medium are rather large.
FIG. 12 is a block diagram showing a hardware configuration of a conventional file recording apparatus.
In FIG. 12, a file recording apparatus 40 includes a controller 41, a media controller 45, an encoder 46, an analog-digital converter (hereinafter, referred to as an AD converter) 47, and an interface 48. The controller 41, the media controller 45 and the encoder 46 are connected to a bus. A camera 20 is connected to the file recording apparatus 40 such that taken videos and audios are inputted in the file recording apparatus 40. An information medium 100 can be attached removably to the file recording apparatus 40.
The controller 41 includes a central processing unit (hereinafter referred to as a CPU) 42 for signal processing, a memory 43 on which work data are stored temporarily during the signal processing at the CPU 42, and a program storing portion 44 in which a program is stored. The CPU 42 and the program storing portion 44 are connected to the bus. In the program storing portion 44, programs such as an operating system are stored.
The media controller 45 can send and receive data or signals with the information medium 100 that can be attached removably to the file recording apparatus 40. For example, when the information medium 100 is formed as a memory card, the media controller 45 includes, for example, a connector to be connected electrically to an electric contact point included in the memory card, and a controlling circuit for controlling recording/reproducing of data or the like with respect to the memory card.
The camera unit 20 is connected to the interface 48 so that a video signal outputted from the camera unit 20 is inputted into the file recording apparatus 40.
The AD converter 47 converts a video signal (analog signal), which is inputted through the interface 48, to a digital video signal.
The encoder 46 compresses the digital video signal outputted from the AD converter 47 by a predetermined signal compression method. For example, the compression method is based on the MPEG4 standards (MPEG: Moving Picture Experts Group) that enables high-compression of dynamic images, but other compression methods can be used without any particular limitations.
The camera unit 20 includes an image pickup device such as a CCD image sensor and a lens, and it converts entering optical images to electric signals and outputs the signals. Operations of the camera unit 20 are controlled by the file recording apparatus 40.
In FIG. 12, an optical image taken with the camera unit 20 is converted to an analog video signal and outputted. The outputted analog video signal is inputted to the AD converter 47 through the interface 48. The AD converter 47 converts the thus inputted analog video signal to a digital video signal and outputs the digital video signal to the encoder 46. The encoder 46 subjects the thus inputted digital video signal to image compression by a predetermined compression format and outputs the signals. The digital video signal is processed at the CPU 42 and at the memory 43 on the basis of OS or the like stored in the program storing portion 44. Specifically, in accordance with a predetermined file system, management information and a file are generated. The thus generated management information and file are recorded on the information medium 100 through the media controller 45.
FIG. 13 is a block diagram showing a software configuration of a conventional file recording apparatus. The configuration as shown in FIG. 13 is included in the controller 41 in FIG. 12. As shown in FIG. 13, the controller 41 includes a file generator 144 for generating a file based on image data outputted from the encoder 46 (see FIG. 12) and a management information generator 145 for generating management information relating to the file generated at the file generator 144.
FIG. 14 is diagram showing contents recorded on an information medium, namely a file recorded by a conventional file recording method using a file system. In FIG. 14, the information medium 100 includes a specific area 102 and a data area 103 in this order when viewed from a logical head address 101. The specific area 102 denotes an area on which management information or the like of the applied file system is recorded. The data area 103 denotes an area on which real data of the file system are recorded.
In the data area 103, a recording file 130 comprising image data is recorded for example. Free areas 132 and 133 exist at parts where recording files are not recorded in the data area 103.
In the specific area 102, a management area 120 exists. In the management area 120, management information or the like is recorded. The management information denotes information including locational information or the like of the area allocated by the recording file 130 in the information medium 100. A free area 121 exists at a part where the management area 120 does not exist in the specific area 102.
An arrow 122 indicates a correlation that the management area 120 is updated corresponding to the end location of the recording file 130.
FIGS. 15A-15C are diagrams showing changes in contents of an information medium according to a conventional file recording method. In FIGS. 15A-15C, information media 100a, 100b and 100c denote examples of recording states of the information medium 100 during recording a file on the information medium 100 in FIG. 14, and FIGS. 15A-15C are arranged in a chronological order.
As shown in FIG. 15A, in the case of recording data additionally on a recording file 130a, the recording location 131a moves as shown as the recording location 131b in FIG. 15B and the recording location 131c in FIG. 15C. That is, the end location of the recording file 130 moves in a direction that the size of the file increases. And then, in accordance with arrows 122a, 122b and 122c, an update of the management information in the management area 120 will be performed without fail by the management information generator 145. Namely, on the information medium 100, rewrite is concentrated often to the management area 120 due to the file system.
In this case, for an information medium having a physical upper limit in the number of data rewriting cycles (for example, an optical disk or a flash memory), concentration of rewriting to the management area 120 can result in partial degradation so as to shorten the life of the information medium. Such a problem can be avoided on the basis of a hardware configuration of an information medium. For a flash memory, for example, a ware-leveling function for averaging the rewrite cycles have been known. Alternatively, a software configuration of an information medium can be relied on for this purpose. In an example of such methods, an area larger than the size of the management information is allocated in a storage area for management information of a file system previously as a reserved area in order to average the number of rewrite cycles of the management information within the reserved area (see JP 2004-79125 A)
However, the above-mentioned methods depending on the hardware configuration can cause problems that averaging of the rewrite numbers cannot be realized at all or partially due to some reasons relating to the standards, materials and configurations or the like of the information medium in use. For example, for an information medium where the whole area is divided into plural blocks and where averaging is limited to within the respective block units, the rewrite numbers among the respective blocks will not be averaged even though the rewrite numbers in the respective blocks will be averaged. That is, the rewrite numbers may be increased in only a specific block including a management area.
Furthermore, since the above-mentioned method depending on a software configuration employs special recording method and management method, compatibility with the existing file systems widely used may not be maintained.